<?php
namespace app\store\model\user;

use app\common\model\user\CouponLog as CouponModel;

/**
 * 返现劵模型
 * Class CouponLog
 * @package app\store\model\user
 */
class CouponLog extends CouponModel
{
    /**
     * 提现打款成功更新返现劵使用状态
     * @param $log_id
     * @return false|int
     * @throws \think\exception\DbException
     */
    public static function grantCouponMoney($log_id)
    {
        $model = self::detail($log_id);
        return $model->save([
            'payment_status' => 20,
        ]);
    }

    /**
     * 审核拒绝恢复优惠券状态
     * @param $log_id
     * @return false|int
     * @throws \think\exception\DbException
     */
    public static function refuseCouponMoney($log_id)
    {
        $model = self::detail($log_id);
        return $model->save([
            'payment_status' => 10,
            'scene' => 10,
        ]);
    }

}